Fractal Block World

Console Commands


This documentation was created for the following version of the program: 0.92.0
One can toggle the console (while in game) by pressing the '~' key.

Commands can be entered while in the console. For example, entering the command "exit" will exit the program.

All commands return a value. One can input complex commands using S-expressions. For example, "echo (vec 1.0 2.0 3.0)" will print "1 2 3" to the console. The outermost S-expression should not have parentheses around it. For another example, "echo (if (== (+ 2 3) 5) 1 0)" will print "1" to the console.

The dollar sign '$' followed by a string literal is syntactic sugar for the "get" command.

One can list all the commands from the console using the help command. This can also be used to print information about individual commands. All that help information is included in this html document. In fact, this document was generated using the "gendoc" command.

Console commands are built into the program. However aliases can be created in user defined scripts. Therefore, in a different configuration of the program, you may not see the same aliases as are listed here.



*
Usage: * X Y

Returns X multiplied by Y. If X and Y are both
ints, then an int will be returned. If one of X
or Y is a float, then a float will be returned.


*=
Usage: *= VAR F

Multiplies the environment variable VAR by the
float F.


+
Usage: + X Y

Returns X plus by Y. If X and Y are both ints,
then an int will be returned. If one of X or Y
is a float, then a float will be returned.


+=
Usage: += VAR X

Multiplies the environment variable VAR by X.
Note: The types of $VAR and X must agree.


..
Usage: .. STR1 STR2 ... STRN

Returns the strings concatenated together.


==
Usage: == EXP1 EXP2

Returns true if the expressions EXP1 and EXP2 are
equal, otherwise returns false.


alias
Usage: alias ALIAS_NAME CMD_STRING

Adds a new alias called ALIAS_NAME which
evaluates to the command CMD_STRING. Although an
existing alias can be replaced by a new alias, a
command cannot be replaced.


cheat
Usage: cheat PASSWORD
cheat PASSWORD nosound
cheat off
cheat chpasswd newpassword

Enables cheat codes if password is correct. Or
disables cheat codes if "cheat off" is used. Can
change the password using "cheat chpasswd".


clear
Usage: clear

Clears the console screen.


close
Usage: close

Closes the game, but does not exit the program.


debug_cf_dump
Usage: debug_cf_dump

Outputs the number of chunk files, and their
revert times.


debug_chunk_dump
Usage: debug_chunk_dump

Dumps information about the chunk that contains
the player. The commands "path" and "script"
also dump useful information about that chunk.


debug_levs_dump
Usage: debug_levs_dump

Outputs how many chunks are on each level.


debug_tex_dump
Usage: debug tex_dump
The command "debug tex_dump" prints:

1) the total memory usage for all loaded
textures, 2) how many seconds it has been since
each texture was used, and 3) the size of each
texture.


debug_wc_dump
NEED_TO_WRITE_HELP


delete
Usage: delete VAR_NAME

Deletes the environment variable. Note: VAR_NAME
must start with "home.".


dumpenv
Usage dumpenv

Prints all of the environment variables to
standard output.


echo
Usage: echo STRING

Prints the string STRING to the console.


exec
Usage: exec COMMAND_STR

Executes the command stored by COMMAND_STR. For
example, "exec $foo" will execute the command
string stored in the environment variable foo.


execf
Usage: execf FILENAME

Executes all the commands in the file FILENAME.
Every line of the file should be either a valid
S-expression or a comment line (all whitespace or
starting with the character '#'). FILENAME
should be a path relative to the directory
Input/Scripts/.


exit
Usage: exit

Exits the program, performing the usual cleanup.


fly
This is an alias for the command
"game_input fly".


freemarkers
This is an alias for the command
"game_input cheat_freemarkers".


game_input
Usage: game_input str

Gives a string to the (package) game code.


gen
This is an alias for the command
"toggle game.package.genesis".


gendoc
Usage: gendoc

Generates an html file with documentation about
all commands.


get
Usage: get VAR

Returns the value stored by the environment
variable VAR. Note that the dollar sign followed
by a string literal is syntactic sugar for the
get command. That is, "$VAR" is equivalent to
"(get VAR)".


get_scr_inv_sel
Usage: screen_inv_selected

Returns which item (in the screen inventory) is
selected.


giveall
This is an alias for the command
"game_input cheat_giveall".


givegold
This is an alias for the command
"game_input cheat_givegold".


giveupgrades
This is an alias for the command
"game_input cheat_giveupgrades".


god
Usage: god

Toggles godmode (invulnerability).


grow
Usage: grow

Grows player to the level that is one coarser.


help
Usage: help
help NAME

The command "help" lists all commands in white
and aliases in pink. The command "help NAME"
prints help information about the command or
alias NAME.


let
Usage: let VAR_NAME VALUE

Creates/sets the environment variable VAR_NAME to
VALUE. Note: VAR_NAME must start with "home.".


load
Usage: load

Loads the last saved game.


ls
Usage: ls
ls PATH
ls PATH v

The command "ls" lists all variables in the
"current working directory" (See also: cd, pwd).
The command "ls PATH" lists all variables in the
name directory PATH. The command "ls PATH v"
lists the name and values of all variables in the
name directory PATH.


noclip
Usage: noclip

Toggles noclip mode (moving through walls).


not
Usage: not BOOL

Returns the negation of the bool BOOL.


path
Usage: path
path list
path listpos
path dump

The command "path" prints the name of the Lua
script for the chunk containing the viewer. The
command "path list" prints the names of the
scripts for all chunks in the path from the root
of the chunk tree to the viewer. The command
"path listpos" does with list does but also
prints the chunk path from the root. The command
"path dump" prints the chunk path to the file
Output/path.txt".


print
Usage: print STR

Prints the string STR to standard output.


respawn
Usage: respawn passive
respawn force

Respawns the player. The passive version only
respawns the player if he is dead. The forceful
version respawns the player no matter what.


save
Usage: save
save nosound

Saves the game.


screenshot
Usage: screenshot

Takes a screenshot and saves to
"Output/Screenshots/" folder.


script
Usage: script

Displays the Lua script for the chunk that
contains the viewer.


seq
Usage: seq EXP_1 EXP_2 ... EXP_N

Evaluates the expressions EXP_1 through EXP_N
from left to right, returning the value that
EXP_N evaluates to. That is, this command can be
used to execute a sequence of commands. For
example, "seq (echo hello) (echo there)" will
print "hello" and then "there" to the console,
and void will be returned (because "(echo there)"
evaluates to void).


set
Usage: set VAR_NAME VALUE

Sets the environment variable VAR_NAME to VALUE.


shrink
Usage: shrink

Shrinks player to the level that is one finer.


shrinkany
Usage: shrinkany

Toggles ability to shrink/enlarge at any time.


takeall
This is an alias for the command
"game_input cheat_takeall".


telehome
Usage: telehome

Teleports you back to your EMERGENCY waypoint.


toggle
Usage: toggle VAR_NAME

Equivalent to "set VAR_NAME (not (get
VAR_NAME))".


tostring
Usage: tostring EXP

Returns the expression EXP converted to a string.


type
Usage: type EXP

Returns the type of the expression EXP. For
example, "echo (type (vec 1.0 2.0 3.0))" will
print "vector" to the console.


unalias
Usage: unalias name ALIAS_NAME
unalias all

The command "unalias name ALIAS_NAME" removes the
alias ALIAS_NAME The command "unalias all"
removes all aliases.


use
Usage: use

"Uses" the basic entity that the player is
looking at.


vec
Usage: vec X Y Z

Returns the vector whose components are the
floats X,Y,Z.